const debounce = (fn, delay) => {
  let timer = null;
  return () => {
    clearTimeout(timer);
    timer = setTimeout(() => {
      fn.apply(this);
    }, delay);
  };
};

window.ResizeObserver = class ResizeObserver extends window.ResizeObserver {
  constructor(callback) {
    super(debounce(callback, 16));
  }
};
